package com.example.medical.Mapper;

import com.example.medical.Bean.Team;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface teamMapper {
    /**
     * 从Team表中查询全部
     * 团队名称，医生姓名，录入者，编辑者，电话
     * @return
     */
    @Select("select * from [Team]")
    List<Team> getAll();

    /**
     * 向Team表中插入团队名称，医生姓名，电话
     */
    @Insert("insert into [Team](ID,doctorName,TeamName,tel) values(#{ID}.#{TeamName},#{doctorName},#{tel})")
    void insert(Team team);

    /**
     * 更新Team表，根据主键（ID）
     * 团队名称，医生姓名，电话
     * @param team
     */
    @Update("update [Team] set TeamName=#{TeamName},doctorName=#{doctorName},tel=#{tel} where ID=#{ID}")
    void update(Team team);
}
